#!/bin/bash
test -f Makefile || ./configure --with-debug --add-module=mymodules/sendfile
make
sudo chown root:root objs/nginx
sudo chmod +s objs/nginx
sudo make install
sudo chmod -R 777  /usr/local/nginx
sudo chmod 7777 /usr/local/nginx/sbin/nginx
processNum=`ps -ef | grep nginx: | grep -v grep | wc -l `
ps -ef | grep nginx 
if [ $processNum -gt 1 ] ; then
	 objs/nginx -s stop
fi

echo "done!"
